<section class="content" xmlns:th="http://www.thymeleaf.org">
   	<div class="panel">
        <div class="panel-body">
         <form id="dataSourceForm" role="form" class="form-horizontal">
			<div class="form-group">
		        <label class="col-md-3 control-label">连接名称:</label>
		        <div class="col-md-5">
		        	<input type="text" name="description" class="form-control" th:value="${dataSource?.description}" required="required" maxlength="200"/>
		        </div>
		    </div>
		    <div class="form-group">
		        <label class="col-md-3 control-label">数据库类型:</label>
		        <div class="col-md-5">
		        	<select name="dbType" class="form-control" required="required">
		        		<option value="">--请选择--</option>
		        		<option value="mysql" th:selected="${dataSource?.dbType == 'mysql'}">MySql</option>
		        		<option value="oracle" th:selected="${dataSource?.dbType == 'oracle'}">Oracle</option>
		        		<option value="sqlserver" th:selected="${dataSource?.dbType == 'sqlserver'}">SQLServer</option>
		        	</select>
		        </div>
		    </div>
		    <div class="form-group">
		        <label class="col-md-3 control-label">数据库名:</label>
		        <div class="col-md-5">
		        	<input type="text" name="dbName" class="form-control" th:value="${dataSource?.dbName}" required="required" maxlength="50"/>
		        </div>
		    </div>
		  	<div class="form-group">
		        <label class="col-md-3 control-label">服务器IP:</label>
		        <div class="col-md-5">
		        	<input type="text" name="server" class="form-control" th:value="${dataSource?.server}" required="required" maxlength="50"/>
		        </div>
		    </div>
		    <div class="form-group">
		        <label class="col-md-3 control-label">端口号:</label>
		        <div class="col-md-5">
		        	<input type="text" name="port" class="form-control" th:value="${dataSource?.port}" required="required" maxlength="50"/>
		        </div>
		    </div>
		    <div class="form-group">
		        <label class="col-md-3 control-label">用户名:</label>
		        <div class="col-md-5">
		        	<input type="text" name="username" class="form-control" th:value="${dataSource?.username}" required="required" maxlength="50"/>
		        </div>
		    </div>
		    <div class="form-group">
		        <label class="col-md-3 control-label">密码:</label>
		        <div class="col-md-5">
		        	<input type="text" name="password" class="form-control" th:value="${dataSource?.password}" required="required" maxlength="50"/>
		        </div>
		    </div>
		    <input type="hidden" name="id" th:value="${dataSource?.id}">
         </form>
        </div>
        <div class="panel-footer">
        	<div class="row">
	        	<div class="col-md-9 col-md-offset-3">
					<button type="button" class="btn btn-primary" onclick="save()">保存</button>
	        		<button type="button" class="btn btn-default" onclick="forwardPage('/dataSource/init')">取消</button>
	      		</div>
      		</div>
        </div>
    </div>
	<script th:src="@{/js/dataSource/dataSource.js}"></script>
</section>